home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / B-C / Color Window Demo / do mouse.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-31  |  1.3 KB  |  50 lines  |  [TEXT/KAHL]

  1. #include "my color.h"
  2.  
  3. void do_mouse_down(the_event)    /* This routine is called for every mouse down event */
  4. EventRecord    *the_event;            
  5. {
  6. CWindowPtr    whichWindow;
  7. long        grow_window_result;
  8. ControlHandle    control;
  9.  
  10.     switch (FindWindow(the_event->where,&whichWindow))    
  11.     {
  12.  
  13.         case inSysWindow:
  14.             SystemClick(&the_event,whichWindow);
  15.             break;
  16.         case inMenuBar:
  17.             DoCommand(MenuSelect(&the_event->where));
  18.             break;
  19.         case inDrag:
  20.             DragWindow(whichWindow,the_event->where,&dragRect);                                    
  21.             break;
  22.         case inContent:
  23.                 if (whichWindow != (CWindowPtr)FrontWindow())
  24.                     SelectWindow(whichWindow);
  25.                 else if(!do_controls(whichWindow, the_event->where))
  26.                 {     
  27.                     GlobalToLocal(&the_event->where);
  28.                     extendedCH = ((the_event->modifiers & shiftKey) != 0);
  29.                     TEClick(the_event->where,extendedCH,textH);
  30.                 } /*else*/
  31.             break;
  32.         case inGoAway:
  33.             if (TrackGoAway (whichWindow, &the_event->where))
  34.                 KillWindow (whichWindow);
  35.             break;
  36.         
  37.         case inGrow:
  38.             grow_window_result = GrowWindow(whichWindow,the_event->where, &screenBits.bounds);
  39.             if(grow_window_result)
  40.             {
  41.                 invalidate_controls(whichWindow);
  42.                 SizeWindow(whichWindow, LoWord(grow_window_result), 
  43.                     HiWord(grow_window_result), TRUE);
  44.                 adjust_scroll_bars(whichWindow);
  45.                 adjust_TE_rect(whichWindow);
  46.             }
  47.             break;
  48.  
  49.     }    /*switch FindWindow*/
  50. }